pCon.planner Plugin SDK  Version 8.16
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Properties | List of all members
X3g::Plugin::Material Class Reference

Material describes how an object interacts with light. More...

Public Member Functions

 Material (System::String^ pName, MaterialType pType)
 Creates a new material within the current document. More...
 
virtual bool Equals (System::Object^ pOther) override
 Compares two Materials. More...
 
virtual int GetHashCode () override
 Hash the Material and get the hash value. More...
 
bool Unlock ()
 Tries to unlock read-only material. More...
 
void BeginEdit ()
 Enables editing of material. More...
 
void EndEdit ()
 Finishes editing of material. More...
 
Image^ GetTextureImage (TextureType pType)
 Returns texture image of given type. More...
 
void SetTextureImage (TextureType pType, Image^ pImage)
 Sets texture image of given type. More...
 
GeMatrix^ GetTextureMatrix (TextureTransformType pType)
 Returns texture matrix for given texture transform type. More...
 
GeMatrix^ GetTextureMatrix (TextureType pTextureType)
 Returns texture matrix for given texture type. More...
 
void SetTextureMatrix (TextureTransformType pType, GeMatrix^ pMatrix)
 Sets texture matrix for given texture transform type. More...
 
IList< SoundAbsorption >^ GetSoundAbsorption ()
 Returns an optional list of sound absorption values. More...
 
void SetSoundAbsorption (IEnumerable< SoundAbsorption >^pValues)
 Sets an optional collection of sound absorption values. More...
 
void WritePreviewImage (Stream^ pPNGStream, MaterialPreviewType pType, int pSize)
 Write PreviewRender Image as PNG stream. More...
 

Static Public Member Functions

static Material^ LoadMatz (array< unsigned char >^pData)
 Load a Material by byte array. More...
 
static Material^ LoadMatz (System::String^ pFileName)
 Load a Material by file. More...
 

Properties

System::String^  Name [get]
 The unique name of the material. More...
 
System::String^  Label [get, set]
 Optional label. More...
 
MaterialType Type [get, set]
 The material type. More...
 
Color BaseColor [get, set]
 Base color. More...
 
bool UseBaseColorFromEntity [get]
 If this flag is set, DbEntity::Color is used instead of BaseColor. More...
 
System::Nullable< float > Albedo [get, set]
 Albedo equals the luminance of the base color or the average luminance of the base color texture in linear color space. More...
 
float Metallic [get, set]
 Metallness of the surface. More...
 
float Roughness [get, set]
 The roughness of the surface. More...
 
float Clearcoat [get, set]
 Weight of clearcoat layer. More...
 
float ClearcoatRoughness [get, set]
 Roughness of clearcoat layer. More...
 
float Sheen [get, set]
 Intensity of sheen layer. More...
 
Color SheenColor [get, set]
 Color of sheen layer. More...
 
float SheenRoughness [get, set]
 Roughness of sheen layer More...
 
float Transparency [get, set]
 Transparency. More...
 
float RefractiveIndex [get, set]
 Index of refraction. More...
 
Color EmissiveColor [get, set]
 Emissive color. More...
 
float Luminance [get, set]
 Luminance. More...
 
bool ReadOnly [get]
 Returns if material is read-only. More...
 

Detailed Description

Material describes how an object interacts with light.

Constructor & Destructor Documentation

X3g::Plugin::Material::Material ( System::String^  pName,
MaterialType  pType 
)

Creates a new material within the current document.

Exceptions
System::NotSupportedExceptionThrown if a material with this name already exists.

Member Function Documentation

void X3g::Plugin::Material::BeginEdit ( )

Enables editing of material.

This method has to be called before any setters.

void X3g::Plugin::Material::EndEdit ( )

Finishes editing of material.

Material is written to database when this function is called.

bool X3g::Plugin::Material::Equals ( System::Object^  pOther)
overridevirtual

Compares two Materials.

Returns
true if both are equal.
false otherwise.
int X3g::Plugin::Material::GetHashCode ( )
overridevirtual

Hash the Material and get the hash value.

IList< SoundAbsorption > X3g::Plugin::Material::GetSoundAbsorption ( )

Returns an optional list of sound absorption values.

Image X3g::Plugin::Material::GetTextureImage ( TextureType  pType)

Returns texture image of given type.

BaseColor and Emissive textures are gamma-corrected (SRGB). Metallic, Roughness, Normal, ClearcoatNormal and Opacity textures are linear.

GeMatrix X3g::Plugin::Material::GetTextureMatrix ( TextureTransformType  pType)

Returns texture matrix for given texture transform type.

GeMatrix X3g::Plugin::Material::GetTextureMatrix ( TextureType  pTextureType)

Returns texture matrix for given texture type.

Convenience function which internally calls GetTextureMatrix() with corresponding texture transform type.

Material X3g::Plugin::Material::LoadMatz ( array< unsigned char >^  pData)
static

Load a Material by byte array.

The byte array should have the content of a matz file.

static Material ^ X3g::Plugin::Material::LoadMatz ( System::String^  pFileName)
static

Load a Material by file.

void X3g::Plugin::Material::SetSoundAbsorption ( IEnumerable< SoundAbsorption >^  pValues)

Sets an optional collection of sound absorption values.

void X3g::Plugin::Material::SetTextureImage ( TextureType  pType,
Image^  pImage 
)

Sets texture image of given type.

The BaseColor and Emissive textures are expected to be in SRGB. Metallic, Roughness, Normal, CleacoatNormal and Opacity textures should be linear.

Setting base color texture resets Albedo.

void X3g::Plugin::Material::SetTextureMatrix ( TextureTransformType  pType,
GeMatrix^  pMatrix 
)

Sets texture matrix for given texture transform type.

bool X3g::Plugin::Material::Unlock ( )

Tries to unlock read-only material.

Returns if unlock succeeded.

void X3g::Plugin::Material::WritePreviewImage ( Stream^  pPNGStream,
MaterialPreviewType  pType,
int  pSize 
)

Write PreviewRender Image as PNG stream.

Parameters
pPNGStreamOutput Stream
pTypeSpecify how to present the preview.
pSizeRender size. Will generate a pSize x pSize image.

Property Documentation

System:: Nullable< float> X3g::Plugin::Material::Albedo
getset

Albedo equals the luminance of the base color or the average luminance of the base color texture in linear color space.

If albedo is null, the base color or base color texture is used for rendering as it is. If albedo is set, the base color or texture is blended with black or white accordingly for rendering. MaterialUtility provides helper functions to apply albedo to base color.

Color X3g::Plugin::Material::BaseColor
getset

Base color.

Base color is gamma-corrected (SRGB).

Setting base color resets Albedo.

float X3g::Plugin::Material::Clearcoat
getset

Weight of clearcoat layer.

float X3g::Plugin::Material::ClearcoatRoughness
getset

Roughness of clearcoat layer.

Color X3g::Plugin::Material::EmissiveColor
getset

Emissive color.

Color of light originating from an object. Emissive color is gamma-corrected (SRGB).

System:: String^ X3g::Plugin::Material::Label
getset

Optional label.

float X3g::Plugin::Material::Luminance
getset

Luminance.

The luminance indicates how much luminous power will be detected by an eye looking at the surface from a particular angle of view.

float X3g::Plugin::Material::Metallic
getset

Metallness of the surface.

System:: String^ X3g::Plugin::Material::Name
get

The unique name of the material.

bool X3g::Plugin::Material::ReadOnly
get

Returns if material is read-only.

It's not allowed to change properties of read-only materials.

float X3g::Plugin::Material::RefractiveIndex
getset

Index of refraction.

Can be changed for MaterialType::Glass only.

float X3g::Plugin::Material::Roughness
getset

The roughness of the surface.

float X3g::Plugin::Material::Sheen
getset

Intensity of sheen layer.

Color X3g::Plugin::Material::SheenColor
getset

Color of sheen layer.

float X3g::Plugin::Material::SheenRoughness
getset

Roughness of sheen layer

float X3g::Plugin::Material::Transparency
getset

Transparency.

Transparency is the percentage of light which passes through the material without being scattered.

MaterialType X3g::Plugin::Material::Type
getset

The material type.

bool X3g::Plugin::Material::UseBaseColorFromEntity
get

If this flag is set, DbEntity::Color is used instead of BaseColor.